<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="">
        <div class="panel panel-success">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse"
                       href="#collapseOne">
                        <span>{:__('基本信息')}</span>
                    </a>

                </h4>
            </div>
            <div id="collapseOne" class="panel-collapse collapse in">
                <div class="panel-body">

                    <div class="col-md-4 col-xs-12 form-group">
                        <label for="c-number" class="control-label col-xs-12 col-sm-2">{:__('回款编号')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-number" data-rule="required" type="text" class="form-control" name="row[number]" value="{$row.number}"/>
                        </div>
                    </div>
                    <div class="col-md-4 col-xs-12 form-group">
                        <label for="c-customer_id" class="control-label col-xs-12 col-sm-2">{:__('客户')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-customer_id" data-rule="required" data-source="facrm/customer/index"
                                   class="form-control selectpage" disabled name="row[customer_id]" type="text" value="{$row.customer_id}">

                        </div>
                    </div>
                    <div class="col-md-4 col-xs-12 form-group">
                        <label for="c-contract_id" class="control-label col-xs-12 col-sm-2">{:__('合同')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-contract_id" data-rule="required" data-source="facrm/contract/index/selectpage"
                                   class="form-control selectpage" disabled name="row[contract_id]" type="text" value="{$row.contract_id}">

                        </div>
                    </div>

                    <div class="col-md-6 col-xs-12 form-group">
                        <label for="pay_type" class="control-label col-xs-12 col-sm-2">收款方式:</label>
                        <div class="col-xs-12 col-sm-8">
                            {:build_radios('row[pay_type]', ['1'=>__('默认方式'), '2'=>__('在线收款')], $row['pay_type'])}
                            <span class="help-block">选择在线收款会生成收款码，客户扫码并支付。</span>
                        </div>
                    </div>




                    <div class="col-md-4 col-xs-12 form-group">
                        <label for="c-money" class="control-label col-xs-12 col-sm-2">{:__('回款金额')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-money" type="number" class="form-control" name="row[money]" value="{$row.money}"/>
                        </div>
                    </div>

                    <div class="pay_type"   {if($row["pay_type"]==2)}style="display:none"{/if}>
                    <div class="col-md-4 col-xs-12 form-group">
                        <label for="c-customer_id" class="control-label col-xs-12 col-sm-2">{:__('收款帐户')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            {:build_select('row[account_id]', $account_list,$row.account_id, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}

                        </div>
                    </div>
                    <div class="col-md-4 col-xs-12 form-group">
                        <label for="c-return_time" class="control-label col-xs-12 col-sm-2">{:__('回款日期')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-return_time" value="{:datetime($row.return_time)}" class="form-control datetimepicker"
                                   data-date-format="YYYY-MM-DD HH:mm" data-use-current="true" name="row[return_time]" type="text" >
                        </div>
                    </div>

                </div>
                <div class="col-md-4 col-xs-12 form-group">
                    <label for="c-flow_admin_id" class="control-label col-xs-12 col-sm-2">{:__('审批人')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-flow_admin_id"  value="{$row.flow_admin_id}"  data-source="facrm/common/selectpage/model/admin/type/all" data-field="nickname" data-multiple="true"  {$flow->config==1?'disabled ':'data-rule="required"'}
                        class="form-control selectpage" name="row[flow_admin_id]" type="text" value="{if $flow->config==1}{$flow->step[0]['admin_ids']}{/if}">
                    </div>
                </div>

                <div class="col-md-4 col-xs-12 form-group">
                    <label for="c-remark" class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <textarea id="c-remark" class="form-control" name="row[remark]">{$row.remark}</textarea>
                    </div>
                </div>

                </div>
            </div>
        </div>


        <div class="panel-group" id="accordion">
            <div class="panel panel-info">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse"
                           href="#collapseThree">
                            收款扩展
                        </a>
                    </h4>
                </div>
                <div id="collapseThree" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div id="extend"></div>

                    </div>
                </div>
            </div>

        </div>

    </div>





    {if (isset($action)&&$action=="detail")}
    {else/}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
    {/if}
</form>

<script>
    var ids={:input('ids')};
</script>




